package com.itheima;

import java.util.Calendar;
import java.util.Scanner;

public class Demo {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入年份: ");
        String next = sc.next();

        Calendar calendar = Calendar.getInstance();

        int year = Integer.parseInt(next);
        calendar.set(year,2,1);

        calendar.add(Calendar.DAY_OF_MONTH,-1);

        System.out.println(calendar.get(Calendar.DAY_OF_MONTH));

    }
}
